package com.gtr.feign;

import com.gtr.entity.VaccinumInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

import java.math.BigDecimal;

@FeignClient("vaccinum-service")
public interface VaccinumFeign { //跨模块调用vaccinum-service模块方法

    @GetMapping("/buyer/vaccinum/findPriceById/{id}")
    public BigDecimal findPriceById(@PathVariable("id") Integer id);

    @GetMapping("/buyer/vaccinum/findById/{id}")
    public VaccinumInfo findById(@PathVariable("id") Integer id);

    @PutMapping("/buyer/vaccinum/subStockById/{id}/{quantity}")
    public Boolean subStockById(@PathVariable("id") Integer id,@PathVariable("quantity") Integer quantity); //减库存

    @PutMapping("/buyer/vaccinum/addStockById/{id}/{quantity}")
    public Boolean addStockById(@PathVariable("id") Integer id,@PathVariable("quantity") Integer quantity); //加库存
}
